package com.monscape.tag_c.supportclasses;

import android.app.Dialog;
import android.view.Window;
import android.view.WindowManager;

import com.monscape.tag_c.R;

public class CustomIndicator {

	private static Dialog dialog = null;

	public static void showIndicatorView() {
		try {
			dialog = new Dialog(AppManager.getInstance().get_currentActivity(),
					android.R.style.Theme_Translucent);
			dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
			dialog.setContentView(R.layout.loading);
			dialog.setCancelable(false);
			dialog.getWindow().setFlags(
					WindowManager.LayoutParams.FLAG_FULLSCREEN,
					WindowManager.LayoutParams.FLAG_FULLSCREEN);

			dialog.show();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void hideIndicatorView() {
		try {
			if (dialog != null) {
				if (dialog.isShowing()) {
					dialog.dismiss();
					dialog = null;
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
